const ghpages = require('gh-pages')
const shell = require('shelljs')

shell.exec('lerna bootstrap && lerna build', { async: true }, () => {
  shell.exec('cd packages/element & npm run build:docs', () => {
    ghpages.publish(
      'packages/element/doc-site',
      {
        branch: 'gh-pages-element',
        repo: 'git@gitee.com:venusJin/formily-fork.git',
      },
      (...args) => {
        console.log('ghpage 同步完成')
        console.log(...args)
      }
    )
  })
})
